<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css"/>
	</head>
	<body>
		<div class="am-g">
			 {include file='../Common/hy_header.html'}
 	<div class="am-u-md-6 am-cf">
        <div class="am-fl am-cf">
          <div class="am-btn-toolbar am-fl">
             <div class="am-btn-group am-btn-group-xs">
            
            <button data-title="新建记者帐号" data-id="edit_reporter_" data-href="index.php?g=admin&m=reporter&a=editReporter" class="am-btn am-btn-default am-btn-xs am-text-secondary hy-js-href"><span class="am-icon-plus"></span> 新建记者帐号</button>
		   
		    </div>
           
          </div>
        </div>
      </div>
      <div class="am-u-md-3 am-cf">
        <div class="am-fr">
        </div>
      </div>
      
      <div class="am-g">
      <div class="am-u-sm-12">
        <div class="am-form">
          <table class="am-table am-table-striped am-table-hover hy-table-main">
            <thead>
              <tr>
                <th class="table-id">序号</th>
                <th class="table-title">登录名</th>
                <th >创建时间</th>
                <th class="table-title">直播</th>
                <th>操作</th>
              </tr>
          </thead>
          <tbody>
          	 {foreach from=$list item=data}
            <tr>
              <td>{$data.id}</td>
              <td>{$data.username}</td>
              <td>{$data.created|date_format:'Y-m-d H:i:s'}</td>
              <td><input {if $data.is_live==1}checked=checked{/if} type="checkbox" onclick="addDigest({$data.id},this)" name="addStatus"></td>
              <td>
              	<button data-id="edit_reporter_{$data.id}" data-title="编辑-{$data.username}" data-href="index.php?g=admin&m=reporter&a=editReporter&id={$data.id}" class="am-btn am-btn-default am-btn-xs am-text-secondary hy-js-href"><span class="am-icon-pencil-square-o"></span> 编辑</button>
              </td>
            </tr>
             {/foreach} 
          </tbody>
        </table>
          <div class="am-cf">

  <div class="am-fr">
 {$page}
  </div>
</div>
          <hr />
      
        </div>
      </div>

    </div>
    </div>
   {include file='../Common/hy_footer.html'}
   <script>
   function addDigest(id,params){
			var url = "index.php?g=admin&m=reporter&a=addLive";
			var data={
					'id':id
				}
			$.post(url,data,function(res){
				if(res.error==0){
					showMsg(res.content,res.error);
					window.location.reload();
				}else{
					params.checked=false;
					alert(res.content);
				}
			},'json');
	}
   </script>
	</body>
</html>
